//
//  UseScrollView.swift
//  learn-ios
//
//  Created by Dong on 2022/4/5.
//

import SwiftUI

struct UseScrollView: View {
    var body: some View {
        VStack {
            Text("横向滚动")
            ScrollView(.horizontal) {
                HStack {
                    Image("gopher1")
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                }
            }

            Text("纵向滚动")
            ScrollView(.vertical) {
                VStack {
                    Image("gopher1")
                        .resizable()
                        .frame(width: 500, height: 1000, alignment: .center)
                        .aspectRatio(contentMode: .fit)
                }
            }
        }
    }
}

struct UseScrollView_Previews: PreviewProvider {
    static var previews: some View {
        UseScrollView()
    }
}
